﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

/*
namespace Design
{
    /// <summary>
    /// 简单工程接口
    /// </summary>
    public interface ICreate
    {
        void Create();
    }

    //人类实现工厂接口
    public class PeoPle : ICreate
    {
        public void Create()
        {
            Console.Write("创建人类");
        }
    }

    public class Animal : ICreate
    {
        public void Create()
        {
            Console.Write("创建动物");
        }
    }

    public class CreateFactory
    {
        /// <summary>
        /// 创建对象方法
        /// </summary>
        /// <param name="createName"></param>
        /// <returns></returns>
        public static ICreate GeneratorCreate(string createName)
        {
            switch (createName)
            {
                case "people":
                    return new PeoPle();
                case "animal":
                    return new Animal();
                default:
                    throw new NotImplementedException();
            }

        }



        #region 优化构造函数中传递接口参数是实例化对象
        ICreate createObj = null;
        public CreateFactory(ICreate obj)
        {
            createObj = obj;
        }
        #endregion
    }




}
 * */


